/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package manager.helpers.table;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import javax.swing.JTable;

/**
 *
 * @author Thiago
 */
public class TableCopy {
    public static void copy(JTable jTable){
        if(jTable.getSelectedColumn()!=0){
            Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
            StringSelection ss = new StringSelection((String)jTable.getValueAt(jTable.getSelectedRow(), jTable.getSelectedColumn()));
            clip.setContents(ss, ss);
        }
    }
}
